﻿/*
* sqlGeometryUtils
* 
* initial implementation : 29.9.2008
*
* Copyright (c) Adam Sida, asida@centrum.cz.
* All rights reserved.
* 
* for license please ask for Petra.Gis.License.txt file
*/
using System;
using System.Data;
using System.Collections.Generic;
using System.Text;
using System.Data.SqlClient;
using System.Data.Sql;
using System.Data.SqlTypes;

using Microsoft.SqlServer.Server;

using Petra.Gis.DataServices;
using Petra.Gis.DataServices.GDO;
using Petra.Gis.DataServices.WKT;
using Petra.Gis.Geometry;

using Petra.Gis.Geometry.Utils;
using Petra.Gis.Geometry.Support;

namespace uhul.data
{
  public partial class sqlGeometryUtils
  {

    public class Trim : IProcessCoordinate
    {

      public void Transform(ICoordinate c)
      {
        double p = Math.Pow(10, Decimals);

        c.X = (Math.Truncate(c.X * p)) / p;
        c.Y = (Math.Truncate(c.Y * p)) / p;
        c.Z = (Math.Truncate(c.Z * p)) / p;

      }


      public int Decimals { get; set; }
    }




  }

}
